<?php
require_once ('./Model/Inscrits.php');
include_once('./MyPDO.php'); 
include_once('./Controller/Template.php');

//API KEY GMAP
//AIzaSyARYj8qvAWyiTFuYXr_3cRImHM08_X5M6k

class Controller_Terrain extends Controller_Template{
    	protected function __construct(){
            parent::__construct();
            $this->selfModel = new Model_Terrain();
		
	}
        
	// Comportement pour un terrain : on affiche sa fiche descriptive
	public function displayFull($idTerrain){
            $sqlReturn = $this->selfModel->getByID($idTerrain);
            require './View/Inscrits/header.tpl';
            if(count($sqlReturn)==0){
            require './View/Error/404.html';
            } else {
                //Def variable du terrain
                require './View/terrain/full.tpl';
            }
            require './View/footer.tpl'; 
	}
}
?>
